package com.tdd.wangxiaoyutdd.test;

/**
 *
 */
public class GameNumber {

    private Integer rawNumber;

    public GameNumber(Integer rawNumber) {
        this.rawNumber = rawNumber;
    }

    @Override
    public String toString(){
        if(isDividedBy(3) && isDividedBy(5)){
            return "fizzbuzz";
        }
        if(isDividedBy(3)){
            return "fizz";
        }
        if(isDividedBy(5)){
            return "buzz";
        }
        return rawNumber.toString();
    }

    private boolean isDividedBy(int i) {
        return rawNumber % i == 0;
    }
}
